package com.zsrt.java.day20170102.lh.petshop;

import org.junit.Test;

public class TestPet {
	
	@Test
	public void testName() throws Exception {
		PetShop ps=new PetShop(3);
		Cat ct=new Cat("小黑","白色",1);
		Dog dg=new Dog("小白","黑色",2);
		Pig pt=new Pig("花花","黑色",3);
		Pig pt1=new Pig("花花1","黑色",3);
		ps.add(ct);
		ps.add(dg);
		ps.add(pt);
		ps.add(pt1);
		
		
		IPet newPets[]=ps.search("黑");
		for (IPet iPet : newPets) {
			System.out.println(iPet.getName()+"--"+iPet.getColor());
		}
		
	}

}
